﻿using System;
using Xenta.Operations;

namespace Xenta.Tests.Operations
{
    public abstract class OperationTest : InfrastructureTest
    {
        protected IOperationProcessor Processor
        {
            get;
            set;
        }

        public override void  TestSetUp()
        {
            base.TestSetUp();

            Processor = new OperationProcessorMock(Infrastructure);
            Processor.Initialize(new WorkingContext
            {
                CID = Guid.NewGuid(),
                IsSafe = true
            });
        }

        public override void  TestTearDown()
        {
            Processor.Rollback();
            Processor.Dispose();
            Processor = null;

            base.TestTearDown();
        }
    }
}
